package com.mlk.bet.controller;

import com.mlk.bet.po.EngBet;
import com.mlk.bet.service.BetService;
import com.mlk.core.component.page.Pager;
import com.mlk.core.util.ServerResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/eng/bet")
public class BetController {

    @Resource
    private BetService betService;

    /**
     * 返回首页
     * @return
     */
    @RequestMapping("index")
    public String index(){
        return "bet/bet";
    }

    /**
     * 获取分页数据
     * @return
     */
    @ResponseBody
    @RequestMapping("listPage")
    public Pager listPage(){
        return this.betService.listPage();
    }

    /**
     * 修改数据
     * @return
     */
    @ResponseBody
    @RequestMapping("update")
    public ServerResponse update(EngBet betPo){
        return this.betService.update(betPo);
    }

}
